package dataStructure.xmg1.a06_copy;

/**
 * @author: vince_zww
 * @date: 2020/12/13 23:06
 * @desceription:
 */
public class Person implements Comparable<Person> {
    private int age;
    private String name;

    public Person(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Person(int age,String name) {
        this.age = age;
        this.name = name;
    }


    @Override
    public int compareTo(Person e) {
        return age - e.age;
    }

    @Override
    public String toString() {
        return age + "_" + name;
    }
}
